package org.ly.uap.client.validation;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.ly.uap.client.util.CommonUtils;

public final class ProxyList {
    private final List<String[]> proxyChains;

    public ProxyList(List<String[]> proxyChains) {
        CommonUtils.assertNotNull(proxyChains, "List of proxy chains cannot be null.");
        this.proxyChains = proxyChains;
    }

    public ProxyList() {
        this(new ArrayList());
    }

    public boolean contains(String[] proxiedList) {
        for (String[] list : this.proxyChains) {
            if (Arrays.equals(proxiedList, list)) {
                return true;
            }
        }

        return false;
    }

    public String toString() {
        return this.proxyChains.toString();
    }
}
